package com.lizba.tips.day3;

import java.util.Optional;
import java.util.stream.Stream;

/**
 * <p>
 *
 * </p>
 *
 * @Author: Liziba
 * @Date: 2021/10/26 21:47
 */
public enum MeetEnums {

    BEEF("牛肉"),
    PORK("猪肉"),
    FISH("鱼肉");

    String name;

    public String getName() {
        return name;
    }

    MeetEnums(String name) {
        this.name = name;
    }

    public static MeetEnums getMeetEnumsByName(String name) {
        MeetEnums[] values = values();
        Optional<MeetEnums> optional = Stream.of(values).filter(v -> v.getName().equals(name)).findAny();
        return optional.isPresent() ? optional.get() : null;
    }

}
